private ["_playerCash", "_newCash", "_playerEXP", "_newEXP", "_expReward", "_moneyReward"];

_sessionID = _this select 0;
_parameters = _this select 1;

_expReward = _parameters select 0;
_moneyReward = _parameters select 1;

_playerObject = _sessionID call ExileServer_system_session_getPlayerObject;

_playerCash = _playerObject getVariable ["ExileMoney", 0];
_playerEXP = _playerObject getVariable ["ExileScore", 0];

_newCash = _playerCash + _moneyReward;
_newEXP = _playerEXP + _expReward;

_playerObject setVariable ["ExileMoney", _newCash, true];
_playerObject setVariable ["ExileScore", _newEXP];

format ["setPlayerMoney:%1:%2", _newCash, (getPlayerUID _playerObject)] call ExileServer_system_database_query_fireAndForget;
format ["setAccountScore:%1:%2", _newEXP, (getPlayerUID _playerObject)] call ExileServer_system_database_query_fireAndForget;

[_sessionID, "completeMissionResponse", [_newEXP, _moneyReward, _expReward]] call AfterlifeServer_system_network_send_to;
